//package com.huonan.test;
//
//import org.openqa.selenium.By;
//import org.openqa.selenium.WebDriver;
//import org.openqa.selenium.WebElement;
//import org.openqa.selenium.chrome.ChromeDriver;
//
//import java.util.ArrayList;
//import java.util.List;
//
//public class TodayHeadlines {
//    private WebDriver driver;
//    private List<String> readArticles;
//
//    public TodayHeadlines() {
//        String chromePath = "path/to/chrome/driver/executable";
//        System.setProperty("webdriver.chrome.driver", chromePath);
//        driver = new ChromeDriver();
//        readArticles = new ArrayList<String>();
//    }
//
//    public void login(String username, String password) {
//        driver.get("https://www.toutiao.com/login/");
//        WebElement usernameElement = driver.findElement(By.name("username"));
//        WebElement passwordElement = driver.findElement(By.name("password"));
//        usernameElement.sendKeys(username);
//        passwordElement.sendKeys(password);
//        passwordElement.submit();
//    }
//
//    public void getReadArticles() {
//        WebElement articleElements = driver.findElement(By.id("article-list"));
//        List<WebElement> articleItems = articleElements.findElements(By.className("article-item"));
//        for (WebElement articleItem : articleItems) {
//            WebElement articleTitle = articleItem.findElement(By.className("title"));
//            String articleTitleText = articleTitle.getText();
//            readArticles.add(articleTitleText);
//        }
//    }
//
//    public void selectArticle(String articleTitle) {
//        WebElement articleElement = driver.findElement(By.className("title"));
//        articleElement.sendKeys(articleTitle);
//        articleElement.submit();
//    }
//
//    public void markAsRead() {
//        WebElement articleElement = driver.findElement(By.className("read-btn"));
//        articleElement.click();
//    }
//
//    public void displayReadArticles() {
//        System.out.println("已读文章：");
//        for (String article : readArticles) {
//            System.out.println(article);
//        }
//    }
//
//    public static void main(String[] args) {
//        TodayHeadlines todayHeadlines = new TodayHeadlines();
//        todayHeadlines.login("username", "password");
//        todayHeadlines.getReadArticles();
//        todayHeadlines.selectArticle("article title");
//        todayHeadlines.markAsRead();
//        todayHeadlines.displayReadArticles();
//    }
//}